package com.leen.admin.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * @author 
 * 数据字典
 */
@Table(name="dict")
@Entity
@Getter
@Setter
@ApiModel(value = "字典信息表")
public class Dict implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "主键Id")
    private Long id;

    /**
     * 字典名称
     */
    @NotBlank(message = "字典名称不能空")
    @Column(name = "name")
    @ApiModelProperty(value = "字典名称")
    private String name;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述")
    @Column(name = "remark")
    private String remark;

    /**
     * 创建日期
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss" )
    @ApiModelProperty(value = "创建日期")
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 更新日期
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss" )
    @ApiModelProperty(value = "更新日期")
    @Column(name = "update_time")
    private Date updateTime;

    @Override
    public String toString() {
        return "Dict{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", remark='" + remark + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", isDel=" + del +
                '}';
    }

    /**
     * 是否删除
     */
    @ApiModelProperty(value = "是否删除")
    @Column(name = "is_del")
    private Byte del;


    private static final long serialVersionUID = 1L;
}